import { httpInstance } from '@/utils/request'

interface FetchTextAPIResData {
  code: number
  data: {
    content: string
    id: number
    name: string
    type: string
  }
  msg: string
  time: string
}

export function fetchTextAPI(keyword: string) {
  return httpInstance.get<
    FetchTextAPIResData,
    Record<string, any>
  >(
    'api/index/text',
    { params: { type: keyword } },
  )
}
